<?php $this->load->view('admin/_begin') ?>
<?php $this->load->view('admin/' . $this->router->fetch_class() . '/_filter') ?>
<form accept-charset="utf-8" method="post" action="<?php echo site_url('admin/'.$this->router->fetch_class() . '/action') ?>">	
  <div id="filter-stage" style="display: block;">	
    <table border="0" class="table-list">
      <thead>
        <tr>
          <th class="align-center" with="30">
            <input type="checkbox" class="check-all" value="" name="action_to_all">
          </th>
          <th><?php echo $this->lang->line("label.discussion.promotion_id") ?></th>
          <th><?php echo $this->lang->line("label.discussion.title") ?></th>
          <th><?php echo $this->lang->line("label.discussion.content") ?></th>
          <th><?php echo $this->lang->line("label.discussion.date_post") ?></th>
          <th><?php echo $this->lang->line("label.discussion.end_user_id") ?></th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($objects as $obj) { ?>
          <tr>
            <td class="align-center">
              <input type="checkbox" value="<?php echo $obj['id'] ?>" name="action_to[]">
            </td>
            <td>
              <?php
              $ref_obj = $this->promotion_model->get($obj["promotion_id"]);
              if ($ref_obj) {
                ?>
                <a href="<?php echo site_url('admin/'."promotion/show/" . $obj["promotion_id"]) ?>">
                <?php echo $this->promotion_model->to_string($ref_obj) ?></a>
              <?php } ?>
            </td><td>
              <?php echo $obj["title"] ?>
            </td><td>
              <?php echo $obj["content"] ?>
            </td><td>
              <?php echo $obj["date_post"] ?>
            </td><td>
              <?php
              $ref_obj = $this->end_user_model->get($obj["end_user_id"]);
              if ($ref_obj) {
                ?>
                <a href="<?php echo site_url('admin/'."end_user/show/" . $obj["end_user_id"]) ?>">
    <?php echo $this->end_user_model->to_string($ref_obj) ?></a>
  <?php } ?>
            </td>
            <td class="actions">
              <a class="btn orange edit" href="<?php echo site_url('admin/'.$this->router->fetch_class() . '/edit/' . $obj['id']) ?>">
  <?php echo $this->lang->line('btn.edit') ?>
              </a>
              <a class="confirm btn red delete" href="<?php echo site_url('admin/'.$this->router->fetch_class() . '/delete/' . $obj['id']) ?>"
                 style="margin-left: 5px">
          <?php echo $this->lang->line('btn.delete') ?></a>					
            </td>
          </tr>
<?php } ?>
      </tbody>
    </table><div class="paging"><?php echo $paging ?></div>
  </div>  
  <div class="table_action_buttons">
    <button class="btn red confirm" value="delete" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.delete') ?></span>
    </button>
  </div>
</form>
<?php $this->load->view('admin/_end') ?>